﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.hive;

namespace SharpSqlAnalyzer.stmt.hive
{
	// Token: 0x020001C0 RID: 448
	public class THiveGrantRole : TCustomSqlStatement
	{
		// Token: 0x06000EEB RID: 3819 RVA: 0x0030ACD0 File Offset: 0x00308ED0
		public THiveGrantRole(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.ssthiveGrantRole;
		}

		// Token: 0x170002BB RID: 699
		// (get) Token: 0x06000EEC RID: 3820 RVA: 0x0030ACE4 File Offset: 0x00308EE4
		// (set) Token: 0x06000EED RID: 3821 RVA: 0x0030ACEC File Offset: 0x00308EEC
		public virtual TObjectNameList RoleList
		{
			get
			{
				return this.roleList;
			}
			set
			{
				this.roleList = value;
			}
		}

		// Token: 0x170002BC RID: 700
		// (get) Token: 0x06000EEE RID: 3822 RVA: 0x0030ACF5 File Offset: 0x00308EF5
		// (set) Token: 0x06000EEF RID: 3823 RVA: 0x0030ACFD File Offset: 0x00308EFD
		public virtual List<THivePrincipalName> Principals
		{
			get
			{
				return this.principals;
			}
			set
			{
				this.principals = value;
			}
		}

		// Token: 0x06000EF0 RID: 3824 RVA: 0x0030AD08 File Offset: 0x00308F08
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			THiveGrantRoleSqlNode thiveGrantRoleSqlNode = (THiveGrantRoleSqlNode)this.rootNode;
			this.roleList = thiveGrantRoleSqlNode.RoleList;
			this.principals = thiveGrantRoleSqlNode.Principals;
			return 0;
		}

		// Token: 0x06000EF1 RID: 3825 RVA: 0x0030AD4C File Offset: 0x00308F4C
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000EF2 RID: 3826 RVA: 0x0030AD5C File Offset: 0x00308F5C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.roleList != null)
			{
				this.roleList.acceptChildren(v);
			}
			if (this.principals != null)
			{
				foreach (THivePrincipalName thivePrincipalName in this.principals)
				{
					thivePrincipalName.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x0400134D RID: 4941
		private TObjectNameList roleList;

		// Token: 0x0400134E RID: 4942
		private List<THivePrincipalName> principals;
	}
}
